{% extends "base/base.html" %}
{% load static %}
{% block title %}
    表单
{% endblock %}


{% block css %}
    <style>
        .row{
            margin-top: 100px;
        }

        html body{
            background-image: url("{% url 'main:home' %}static/img/background1.jpg");
            background-repeat: no-repeat;
            background-position: center center;
            background-size: cover;
            background-attachment: fixed;

        }
    </style>
{% endblock %}


{% block main %}
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            <h1 style="text-align: center;color: lightcoral">欢迎来到商城管理系统</h1>
            <br><br><br><br>
            <h2 style="text-align: center;color: black">登录</h2>

            <form action="" method="post">
                {% csrf_token %}
                <div class="form-group">
                    {{ form.username.label_tag }}
                    {{ form.username }}
                    {% if form.username.errors %}
                        {% for error in form.username.errors %}
                            <div class="alert alert-danger" role="alert">{{ error }}</div>
                        {% endfor %}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.password.label_tag }}
                    {{ form.password }}
                    {% if form.password.errors %}
                        {% for error in form.password.errors %}
                            <div class="alert alert-danger" role="alert">{{ error }}</div>
                        {% endfor %}
                    {% endif %}
                </div>

                <div class="form-group">
                    <div class="col-md-6 col-md-offset-3">
                        <button type="submit" class="btn btn-danger">登录</button>
                        <a class="btn btn-default" href="{% url 'user:regist' %}" role="button" style="background-color: greenyellow; color:red">找回密码</a>

                        <a class="btn btn-default" href="{% url 'user:regist' %}" role="button">没有账号，去注册</a>
                    </div>

                </div>
            </form>
        </div>

    </div>



{% endblock %}
